package com.example.administrator.waitan.mine;

import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.util.Log;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;

import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.ImageRequest;
import com.android.volley.toolbox.NetworkImageView;
import com.android.volley.toolbox.Volley;
import com.example.administrator.waitan.R;
import com.example.administrator.waitan.base.BaseActivity;
import com.example.administrator.waitan.tools.VolleySingleton;

/**
 * Created by Administrator on 2016/1/26.
 */
public class MineMessageActivity extends BaseActivity {
    private ImageView readerPic;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mine_message);
        Intent intent = getIntent();
        String id = intent.getStringExtra("id");
        String name = intent.getStringExtra("name");
        String imgUrl = intent.getStringExtra("url");
        readerPic = (ImageView) findViewById(R.id.iv_mineMessage_reader_picture);
        TextView readerName = (TextView) findViewById(R.id.tv_mineMessage_reader_name);
        TextView readerNumber = (TextView) findViewById(R.id.tv_mineMessage_reader_number);
        VolleySingleton.getImageLoader().get(imgUrl,VolleySingleton.getImageListener(readerPic));
//        RequestQueue queue = Volley.newRequestQueue(this);
//        imgUrl += ".jpg";
//        ImageRequest request = new ImageRequest(imgUrl, new Response.Listener<Bitmap>() {
//            @Override
//            public void onResponse(Bitmap response) {
//                readerPic.setImageBitmap(response);
//                Log.d("tag",response.toString());
//            }
//        }, 300, 300, ImageView.ScaleType.FIT_XY, Bitmap.Config.RGB_565, new Response.ErrorListener() {
//            @Override
//            public void onErrorResponse(VolleyError error) {
//                Log.d("tags",error.toString());
//            }
//        });
//        queue.add(request);
        readerName.setText(name);
        readerNumber.setText(id);
    }
}
